﻿using System;
using System.ComponentModel;
using Validate.Net;
using Validate.Net.Core;
using Validate.Net.Internals;
using Validate.Net.Internals.Globalization.zh_CN;
using Validate.Net.Internals.Regulars;

namespace Test
{
    public class UserModel : IVerify
    {
        /// <summary>
        /// 校验字符串必填 (Empty) 
        /// </summary>
        //[ValidateRequired]
        [Description("密码")]
        [Required("必须填写内容 - 内联提示语")]
        public string Password { get; set; }

        /// <summary>
        /// 校验字符串必填 (校验 WhiteSpace 的情况)
        /// </summary>
        [Required]
        public string PasswordWhiteSpace { get; set; }

        /// <summary>
        /// 校验字符串必填 (不校验 WhiteSpace 的情况)
        /// </summary>
        [Required(SkipWhiteSpace = true)]
        public string PasswordSkipWhiteSpace { get; set; }

        /// <summary>
        /// 校验字符串长度区间
        /// </summary>
        //[ValidateRangeLength(6, 20)]
        [Description("用户账户")]
        [StringLength(MinLength = 6, MaxLength = 20)]
        public string Account { get; set; }

        /// <summary>
        /// 校验字母，只能包含字母
        /// </summary>
        //[ValidateLetter]
        [Alphabet]
        public string Letter { get; set; }

        /// <summary>
        /// 校验最大值
        /// </summary>
        //[ValidateMaxValue(20)]
        [Range(Maximum = 20)]
        public int Age { get; set; }

        /// <summary>
        /// 校验最小值
        /// </summary>
        //[ValidateMinValue(5)]
        [Range(Minimum = 5)]
        public int MinLong { get; set; }

        /// <summary>
        /// 校验值区间
        /// </summary>
        //[ValidateRangeValue(10, 20)]
        [Range(Minimum = 10, Maximum = 20)]
        [NotDefault]
        [Required]
        public int AgeRange { get; set; }

        /// <summary>
        /// 校验最大长度
        /// </summary>
        //[ValidateMaxLength(20)]
        [StringLength(MaxLength = 20)]
        public string MaxLength { get; set; }

        /// <summary>
        /// 校验最小长度
        /// </summary>
        //[ValidateMinLength(5)]
        [StringLength(MinLength = 5)]
        public string MinLength { get; set; }

        /// <summary>
        /// 校验Email
        /// </summary>
        //[ValidateEmail]
        [Email]
        public string Email { get; set; }

        /// <summary>
        /// 校验邮编
        /// </summary>
        //[ValidateZipCode]
        public string ZipCode { get; set; }

        /// <summary>
        /// 校验包含中文
        /// </summary>
        //[ValidateChinese]
        [Chinese]
        public string Chinese { get; set; }

        /// <summary>
        /// 校验负整数
        /// </summary>
        //[ValidateNegtiveInt]
        public int NegtiveInt { get; set; }

        /// <summary>
        /// 校验正整数
        /// </summary>
        //[ValidatePositiveInt]
        public int PositiveInt { get; set; }

        /// <summary>
        /// 校验非负整数
        /// </summary>
        //[ValidateNonnegativeInt]
        public double NonnegativeInt { get; set; }

        /// <summary>
        /// 校验非正整数
        /// </summary>
        //[ValidateNonpositiveInt]
        public double NonpositiveInt { get; set; }

        /// <summary>
        /// 校验ip地址
        /// </summary>
        //[ValidateIp]
        [IpAddress]
        public string Ip { get; set; }

        /// <summary>
        /// 校验url
        /// </summary>
        //[ValidateUrl]
        public string url { get; set; }

        /// <summary>
        /// 校验qq号
        /// </summary>
        //[ValidateQQ]
        public string QQ { get; set; }

        /// <summary>
        /// 自定义正则校验，特性[ValidateRegular]为自定义正则表达式校验
        /// 第一个参数为您的正则表达式，第二个参数为自定义校验不合法时的提示信息
        /// </summary>
        //[ValidateRegular("^[0-9]{6}$", "邮编格式校验失败(自定义)")]
        [CustomRegex("^[0-9]{6}$", "邮编格式校验失败(自定义)")]
        public string CustomStr { get; set; }

        /// <summary>
        /// 校验身份证（15位身份证号，和18位身份证号）
        /// </summary>
        //[ValidateIDCard]
        [IDCardNum]
        public string IDCard { get; set; }

        /// <summary>
        /// 校验统一社会信用代码
        /// </summary>
        //[ValidateSocialCreditCode]
        [USCI]
        public string SocialCreditCode { get; set; }

        /// <summary>
        /// 一般密码校验（包含数字和字母及常规特殊符号）
        /// </summary>
        //[ValidatePwd]
        public string Pwd { get; set; }

    }
}
